package com.ls.atf.utils;

import java.io.IOException;
import java.net.URL;
import java.util.Properties;

public class ConfigProperties {

	private static Properties APP_PROPERTIES;
	private static Properties DATA_PROPERTIES;

	static {
		APP_PROPERTIES = new Properties();
		URL props = ClassLoader.getSystemResource("app.properties");
		try {
			APP_PROPERTIES.load(props.openStream());
		} catch (IOException e) {
			e.printStackTrace();
		}
		DATA_PROPERTIES = new Properties();
		props = ClassLoader.getSystemResource("data.properties");
		try {
			DATA_PROPERTIES.load(props.openStream());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static String getAppProperties(String key) {
		return APP_PROPERTIES.getProperty(key);
	}

	public static String getDataProperties(String key) {
		return DATA_PROPERTIES.getProperty(key);
	}

}
